package com.windy.controller;

import com.windy.api.product.ProductClient;
import com.windy.app.entity.Product;
import com.windy.service.IAppIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("windy")
public class AppIndexController {

    @Autowired
    private IAppIndexService appIndexService;

    @GetMapping("getProductById")
    public String getProductById(@RequestParam(name = "id") Long id){
        return ""+id;
    }

    @GetMapping("indexFindProductById")
    public Product findProductById(@RequestParam(name = "id") Long id){
        return appIndexService.findProductById(id);
    }
}
